package com.itheima.consumer.config;


import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class fanoutConfiguration {

    @Bean
    public FanoutExchange fanoutExcahnge() {
        return new FanoutExchange("hello.fanout");
    }


    @Bean
    public Queue fanoutQueue() {
        Queue build = QueueBuilder.durable("fanout.durable1").build();
        return build;
    }


    @Bean
    public Binding fanoutBinding() {
        return BindingBuilder.bind(fanoutQueue()).to(fanoutExcahnge());
    }

}
